/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.aqlm.data;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.rainbow.annotation.xml.NodeText;

/**
 *
 * @author hironaga
 */
public class RsvDateUDO {

    private static DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
    private static DateFormat timeFormat = new SimpleDateFormat("HH:mm");

    @NodeText( elementName="date" )
    private String date;    //"YYYY/MM/DD"

    @NodeText( elementName="start-time" )
    private String startTime;   //"HH:MM""

    @Override
    public String toString() {
        return //super.toString();
                " date: " + this.date +
                ", start-time: " + this.startTime;
    }

    public String getYyyyMm(){
        return this.date.substring(0, 3).concat(this.date.substring(5, 6));
    }

    public String getDate() {
        return date;
    }

    public Date getDateOnDateType() {
        return UDOUtils.getOnDateType(this.date, dateFormat);
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getStartTime() {
        return startTime;
    }

    public Date getStartTimeOnDateType() {
        return UDOUtils.getOnDateType(this.startTime, timeFormat);
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public static void setTimeFormat(DateFormat timeFormat) {
        RsvDateUDO.timeFormat = timeFormat;
    }



}
